package gulimall;

import java.util.concurrent.locks.ReentrantLock;

/**
 * 使用JUC的ReentrantLock
 * @author HLF
 * @date 2022/7/7 10:12
 */
public class ReentrantLock02 {
    public static void main(String[] args) {


    }
}

class MyThread02{
    public void goHome(){

    }


    public void goBedroom(){
        String name = Thread.currentThread().getName();

        ReentrantLock reentrantLock = new ReentrantLock();

        try {
            reentrantLock.lock();


        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            reentrantLock.unlock();
        }
    }
}
